package org.xwb.springcloud.messagetype.direct;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.xwb.springcloud.constant.MqConstant;

/**
 * @author 10564
 */
@Component
public class DirectConsumer {
    private static final Logger log = LoggerFactory.getLogger(DirectConsumer.class);
    //监听queue1队列
    @RabbitListener(queues = MqConstant.DIRECT_QUEUE_ONE)
    public void receiveHelloQueueMessage1(String msg) {
        log.info("\n路由模式消费者one-监听队列one-路由键one 收到消息:{}\n",msg);
    }

    //监听queue2队列
    @RabbitListener(queues = MqConstant.DIRECT_QUEUE_TWO)
    public void receiveHelloQueueMessage2(String msg) {
        log.info("\n路由模式消费者two-监听队列two-路由键two 收到消息:{}\n",msg);
    }
}
